package homelesspartners.client.widgets;

import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class PrivacyPolicyWidget extends DialogBox implements ClickListener {

	private PushButton close = new PushButton("Close", this);

	private static PrivacyPolicyWidget instance = new PrivacyPolicyWidget();

	public static PrivacyPolicyWidget getInstance() {
		return instance;
	}

	public static void prompt() {
		instance.center();
		instance.show();
	}

	public PrivacyPolicyWidget() {
		setText("Homeless Partners Privacy Policy");

		close.addClickListener(this);

		HTML text =
				new HTML(
						"<br />At Homeless Partners, we take the privacy of our generous donors very seriously.<br /><br />"
								+ "<b>We will not:</b><ul>"
								+ "<li>sell or share your email address with any other people or organizations</li>"
								+ "<li>send you any unwanted information for this program or any other purpose</li>"
								+ "<li>distribute your email address to anyone in our program, except for a limited number of volunteers who help manage the gifts and pledges</li></ul>"
								+ "<b>We will:</b><ul>"
								+ "<li>treat your contact info with due care</li>"
								+ "<li>send you a brief thank you note for your gift pledges</li>"
								+ "<li>delete your contact info from our systems at the conclusion of our annual program</li></ul>"
								+ "For more information, please see the 'questions' page on the Home tab.  Thanks!<br /><br />"
								+ "<b>Anonymous Donations</b><br/>"
								+ "If you would prefer to remain completely anonymous, you are welcome to do so. "
								+ "Simply send your gifts to the shelters without registering them here first. "
								+ "Please note however, that since someone else may still pledge the same gift, your gift may be redistributed to another worthy person in need if duplicates are received.<br /><br />");
		VerticalPanel panel = new VerticalPanel();

		text.setWidth("600px");

		panel.add(text);
		panel.add(close);

		setWidget(panel);
	}

	public void onClick(Widget sender) {
		if (sender == close) {
			hide();
		}
	}

}
